<template>
    <div>
        <div class="logo">
            <img src="~@/assets/logo.png" alt="">
        </div>
        <div class="user">
            <a-avatar :size="54" icon="user" />
            <div class="username">管理员：{{userInfo.realName}} <a href="javascript:;" @click="logout" style="color:#fff;font-size:15px">退出</a></div>
            <div class="dept">{{userInfo.organName}}</div>
        </div>
        <div class="nav">
            <div class="navList">
                <router-link to="/inputs_cube">数据库维护</router-link>
                <a-divider type="vertical" />
                <router-link to="/inputs_data">数据维护</router-link>
                <a-divider type="vertical" />
                <router-link to="/inputs_dictionary">维度字典</router-link>
                <a-divider type="vertical" />
                <router-link to="/inputs_reback">意见反馈</router-link>
                <a-divider type="vertical" />
                <router-link to="/inputs_article">原文存储</router-link>
            </div>
        </div>
    </div>
</template>

<script>
import { delCookie, delSessionItem } from '../../../until/tools'
export default {
    computed:{
        userInfo() {
            return this.$store.getters.getUserInfo
        }
    },
    methods:{
        logout() {
            var that = this;
            this.$confirm({
                title: '提示',
                content: '您确定要退出吗？',
                okText: '确定',
                cancelText: '取消',
                centered:true,
                onOk() {
                    delCookie('bd_sid');
                    delCookie('canInput');
                    delSessionItem('dims');
                    that.$router.push('/login');
                }
            })
        }
    }
}
</script>